//声明一个数组，使用do-while对数组的元素进行翻转
let arr = [1, 2, 3, 4, 5, ]

function reverse() {
    //数组的起始下标
    let start = 0
    //数组的结尾下标
    let end = arr.length - 1
    do {
        let t = arr[start]
        arr[start] = arr[end]
        arr[end] = t
        start++
        end--

    } while (start <= end)
    return arr
}
console.log(reverse([1, 2, 3, 4, 5, 6]))